<%--
  Created by IntelliJ IDEA.
  User: feng
  Date: 2023/5/12
  Time: 11:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>体育馆管理系统</title>
    <meta name="description" content="体育馆管理系统">
    <meta name="keywords" content="体育馆管理系统">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="<%=request.getContextPath()%>/resources/plugins/elementui/index.css">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/resources/plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/resources/css/style.css">
    <!-- 引入组件库 -->
    <script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/jquery.min.js"></script>
    <script src="<%=request.getContextPath()%>/resources/js/vue.js"></script>
    <script src="<%=request.getContextPath()%>/resources/plugins/elementui/index.js"></script>
    <script src="<%=request.getContextPath()%>/resources/js/axios-0.18.0.js"></script>
    <style>
        .demo-table-expand {
            font-size: 0;
        }
        .demo-table-expand label {
            width: 90px;
            color: #99a9bf;
        }
        .demo-table-expand .el-form-item {
            margin-right: 0;
            margin-bottom: 0;
            width: 50%;
        }
        /*.el-icon-arrow-right:before{
            display: none;
        }
         */
    </style>
    <style>
        .datatable {
            position: relative;
            box-sizing: border-box;
            -webkit-box-flex: 1;
            width: 100%;
            max-width: 100%;
            font-size: 14px;
            color: rgb(96, 98, 102);
            overflow: hidden;
            flex: 1 1 0%;
        }
        .datatable td, .datatable th {
            padding: 12px 0;
            min-width: 0;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
            text-overflow: ellipsis;
            vertical-align: middle;
            position: relative;
            text-align: left;
        }
    </style>
</head>
<body class="hold-transition">
<div id="app">
    <div class="content-header">
        <h1>赛事管理<small>赛事管理</small></h1>
        <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>赛事管理</el-breadcrumb-item>
        </el-breadcrumb>
    </div>
    <div class="app-container">
        <div class="box">
            <div class="filter-container">
                <el-input placeholder="比赛号/比赛名" v-model="pagination.queryString" style="width: 200px;"
                          class="filter-item" @keyup.enter.native="handleFilter"></el-input>
                <el-date-picker
                        v-model="pagination.contestStartTime"
                        type="date"
                        class="filter-item"
                        format="yyyy 年 MM 月 dd 日"
                ></el-date-picker>
                <el-button @click="findPage()" class="dalfBut">查询</el-button>
                <el-button type="primary" class="butT" @click="handleCreate()">新建</el-button>
            </div>
            <el-table
                    :data="dataList"
                    style="width: 100%"
                    :row-key="getRowKeys"
                    :expand-row-keys="expands"
                    @row-click="clickRowHandle"
            >
                <el-table-column type="expand" >
                    <template slot-scope="props" >
                        <el-form label-position="left" inline class="demo-table-expand">
                            <el-table size="small" current-row-key="contesNo" :data="dataListGame" border :header-cell-style="{background:'#f5f7fa',color:'#606266'}" stripe highlight-current-row >
                                <el-table-column type="index" align="center" label="序号"></el-table-column>
                                <el-table-column prop="contesNo" label="赛事编号" align="center"></el-table-column>
                                <el-table-column prop="contestName" label="赛事名称" align="center"></el-table-column>
                                <el-table-column prop="contestStartTime" label="赛事开始时间" align="center"></el-table-column>
                                <el-table-column prop="contestEndTime" label="赛事结束时间" align="center"></el-table-column>
                                <el-table-column prop="contestFild" label="比赛队伍" align="center"></el-table-column>
                                <el-table-column label="操作" align="center">
                                    <template slot-scope="scope">
                                        <el-button type="primary" size="mini" @click="handleUpdateGame(scope.row)">编辑</el-button>
                                        <el-button size="mini" type="danger" @click="handleDeleteGame(scope.row)">删除</el-button>
                                    </template>
                                </el-table-column>
                            </el-table>
                        </el-form>
                    </template>
                </el-table-column>
                <el-table-column type="index" align="center" label="序号"></el-table-column>
                <el-table-column prop="competitionNo" label="比赛编号" align="center"></el-table-column>
                <el-table-column prop="competitionName" label="比赛名称" align="center"></el-table-column>
                <el-table-column prop="contestStartTime" label="比赛开始时间" align="center"></el-table-column>
                <el-table-column prop="canCompetition" label="参赛资格" align="center"></el-table-column>
                <el-table-column label="操作" align="center">
                    <template slot-scope="scope">
                        <el-button type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button>
                        <el-button type="primary" size="mini" @click="handleAddMess(scope.row)">添加</el-button>
                        <el-button size="mini" type="danger" @click="handleDelete(scope.row)">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <div class="pagination-container">
                <el-pagination
                        class="pagiantion"
                        @current-change="handleCurrentChange"
                        :current-page="pagination.pageNow"
                        :page-size="pagination.pageSize"
                        layout="total, prev, pager, next, jumper"
                        :total="pagination.total">
                </el-pagination>
            </div>


            <!-- 新增标签弹层 -->
            <div class="add-form"  >
                <el-dialog title="新增比赛" :visible.sync="dialogFormVisible" >
                    <template>
                        <el-tabs v-model="activeName" type="card">
                            <el-tab-pane label="基本信息" name="first">
                                <el-form label-position="right" label-width="100px">
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="比赛名称">
                                                <el-input v-model="formData.competitionName"/>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="赛事开始时间">
                                                <el-input v-model="formData.contestStartTime"
                                                          type="date"
                                                          style="width: 200px;"
                                                          class="filter-item"
                                                          placeholder="选择日期"
                                                          format="yyyy 年 MM 月 dd 日"
                                                          :picker-options="expireTimeOPtion">
                                                </el-input>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="参赛资格">
                                                <el-input v-model="formData.canCompetition"/>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="比赛创建者">
                                                <el-input v-model="formData.lesseeID"/>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="24">
                                            <el-form-item label="备注">
                                                <el-input v-model="formData.remark" type="textarea"></el-input>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                </el-form>
                            </el-tab-pane>

                        </el-tabs>
                    </template>
                    <div slot="footer" class="dialog-footer">
                        <el-button @click="dialogFormVisible = false">取消</el-button>
                        <el-button type="primary" @click="handleAddGame()">确定</el-button>
                    </div>
                </el-dialog>
            </div>

            <!-- 编辑标签弹层 -->
            <div class="add-form" >
                <el-dialog title="编辑赛事" :visible.sync="dialogFormVisible4Edit" >
                    <template>
                        <el-tabs v-model="activeName" type="card">
                            <el-tab-pane label="基本信息" name="first">
                                <el-form label-position="right" label-width="100px">
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="比赛名称">
                                                <el-input v-model="formData.competitionName"/>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="赛事开始时间">
                                                <el-input v-model="formData.contestStartTime"
                                                          type="date"
                                                          style="width: 200px;"
                                                          class="filter-item"
                                                          placeholder="选择日期"
                                                          format="yyyy 年 MM 月 dd 日"
                                                          :picker-options="expireTimeOPtion">
                                                </el-input>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="参赛资格">
                                                <el-input v-model="formData.canCompetition"/>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="比赛创建者">
                                                <el-input v-model="formData.lesseeID"/>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="24">
                                            <el-form-item label="备注">
                                                <el-input v-model="formData.remark" type="textarea"></el-input>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                </el-form>
                            </el-tab-pane>

                        </el-tabs>
                    </template>
                    <div slot="footer" class="dialog-footer">
                        <el-button @click="dialogFormVisible4Edit = false">取消</el-button>
                        <el-button type="primary" @click="handleChange()">确定</el-button>
                    </div>
                </el-dialog>
            </div>
            </div>

            <!-- 添加赛事标签弹层 -->
            <div class="add-form" style="width: 1000px">
                <el-dialog title="添加赛事" :visible.sync="dialogFormVisible4EditAddGame" width="90%">
                    <div class="app-container" >
                        <div class="box">
                            <el-tabs v-model="activeName" type="card">
                                <el-form label-position="right" label-width="140px">
                                    <el-row>

                                        <el-col :span="6">
                                            <el-form-item label="比赛号">
                                                <el-input v-model="formData.competitionNo" :disabled="true"/>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="6">
                                            <el-form-item label="赛事裁判">
                                                <el-input v-model="formData.refereeName"/>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="8">
                                            <el-form-item label="赛事时间">
                                                <el-date-picker
                                                        v-model="formData.contestTime"
                                                        type="datetimerange"
                                                        range-separator="至"
                                                        start-placeholder="开始日期"
                                                        end-placeholder="结束日期"
                                                        :default-time="['00:00:00', '23:59:59']"
                                                        format="yyyy-MM-dd HH:mm:ss"
                                                >
                                                </el-date-picker>

                                            </el-form-item>
                                        </el-col>

                                    </el-row>
                                    <el-row>
                                        <el-col :span="9">
                                            <el-form-item label="赛事场地">
                                                <el-input v-model="formData.contestFild" ></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="2">
                                            <el-button type="primary" class="butT" @click="findSite()">选择</el-button>
                                        </el-col>
                                        <el-col :span="9">
                                            <el-form-item label="使用器材">
                                                <el-input v-model="formData.useEquipment"/>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="2">
                                            <el-button type="primary" class="butT" @click="findEquipment()">选择</el-button>
                                        </el-col>

                                    </el-row>
                                    <el-row>
                                        <el-col :span="6">
                                            <el-form-item label="赛事名称">
                                                <el-input v-model="formData.contestName"/>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="8">

                                            <el-form-item label="比赛队伍1">
                                                <el-select v-model="formData.matchTeamOne" placeholder="选择比赛队伍">
                                                    <el-option v-for="plate in plates" :value="plate.teamNo" :key="plate.teamName"
                                                               :label="plate.teamName"></el-option>
                                                </el-select>
                                               <%-- <el-input v-model="formData.matchTeamOne" type="matchTeam"></el-input>--%>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="8">

                                            <el-form-item label="比赛队伍2">
                                                <el-select v-model="formData.matchTeamTwo" placeholder="选择比赛队伍">
                                                    <el-option v-for="plate in plates" :value="plate.teamName" :key="plate.plateId"
                                                               :label="plate.teamName"></el-option>
                                                </el-select>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="22">
                                            <el-form-item label="备注">
                                                <el-input v-model="formData.remark" type="roleId"></el-input>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                </el-form>


                            </el-tabs>
                            <div class="filter-container">
                                <el-button @click="dialogFormVisible4EditAddGame = false">取消</el-button>
                                <el-button type="primary" class="butT" @click="handleAdd()">添加比赛</el-button>
                            </div>

                            <!-- 场地选择 -->
                            <div class="add-form" style="width: 800px">
                                <el-dialog title="场地选择" :visible.sync="dialogFormVisible4EditCloseSite"  append-to-body>
                                    <template>
                                        <el-tabs v-model="activeName" type="card">
                                            <el-tab-pane label="基本信息" name="first">
                                                <el-form label-position="right" label-width="100px">
                                                    <div class="filter-container" >
                                                        <el-input placeholder="场地号/场地名" v-model="site.queryString" style="width: 200px;"
                                                                  class="filter-item" @keyup.enter.native="handleFilter"></el-input>
                                                        <el-input v-model="site.orderData"
                                                                  type="date"
                                                                  style="width: 200px;"
                                                                  class="filter-item"
                                                                  placeholder="选择日期"
                                                                  format="yyyy 年 MM 月 dd 日"
                                                                  :picker-options="expireTimeOPtion">
                                                        </el-input>
                                                        <el-select placeholder="请选择" v-model="site.orderTimeSub"  style="width: 200px;" class="filter-item">
                                                            <el-option v-for="item in kindList" :key="item.id" :value="item.name"></el-option>
                                                        </el-select>
                                                        <el-button @click="findSite()" class="dalfBut">查询</el-button>

                                                    </div>
                                                    <el-table size="small" current-row-key="placeNo" :data="dataListSiteMess" empty-text='暂无数据，稍后重试' stripe highlight-current-row>
                                                        <el-table-column type="index" align="center" label="序号"></el-table-column>
                                                        <el-table-column prop="placeNo" label="场地号" align="center"></el-table-column>
                                                        <el-table-column prop="placeName" label="场地名" align="center"></el-table-column>
                                                        <el-table-column prop="orderData" label="租用日期" align="center"></el-table-column>
                                                        <el-table-column prop="orderTimeSub" label="时间段" align="center"></el-table-column>
                                                        <el-table-column  prop="rentalQuantity" label="操作" align="center">
                                                            <template slot-scope="scope">
                                                                <el-button type="primary" size="mini" @click="handleChoseSite(scope.row)">选择</el-button>
                                                            </template>
                                                        </el-table-column>
                                                    </el-table>
                                                    <div class="pagination-container">
                                                        <el-pagination
                                                                class="pagiantion"
                                                                :current-page="site.pageNow"
                                                                :page-size="site.pageSize"
                                                                layout="total, prev, pager, next, jumper"
                                                                :total="site.total">
                                                        </el-pagination>
                                                    </div>
                                                </el-form>
                                            </el-tab-pane>

                                        </el-tabs>
                                    </template>
                                    <div slot="footer" class="dialog-footer">
                                        <el-button type="primary" @click="cancel()">取消</el-button>
                                        <el-button @click="dialogFormVisible4EditCloseSite = false">确定</el-button>
                                    </div>
                                </el-dialog>
                            </div>

                            <!-- 器材选择 -->
                            <div class="add-form" style="width: 1000px">
                                <el-dialog title="器材选择" :visible.sync="dialogFormVisible4EditCloseEquipment" width="80%" append-to-body>
                                    <template>
                                        <el-tabs v-model="activeName" type="card" >
                                            <el-tab-pane label="基本信息" name="first" >
                                                <el-form label-position="right" label-width="1000px">
                                                    <div class="filter-container" >
                                                        <el-input placeholder="器材号/器材名" v-model="pagination.queryString" style="width: 200px;"
                                                                  class="filter-item" @keyup.enter.native="handleFilter"></el-input>
                                                        <el-input v-model="pagination.rentData"
                                                                  type="date"
                                                                  style="width: 200px;"
                                                                  class="filter-item"
                                                                  placeholder="选择日期"
                                                                  format="yyyy 年 MM 月 dd 日"
                                                                  :picker-options="expireTimeOPtion">
                                                        </el-input>
                                                        <el-select placeholder="请选择" v-model="pagination.rentTimeSub"  style="width: 200px;" class="filter-item">
                                                            <el-option v-for="item in kindList" :key="item.id" :value="item.name"></el-option>
                                                        </el-select>
                                                        <el-button @click="findEquipment()" class="dalfBut">查询</el-button>

                                                    </div>
                                                    <el-table size="small" current-row-key="placeNo" :data="equipment" :key="cerTinFoKey" empty-text='暂无数据，稍后重试'
                                                              stripe highlight-current-row>
                                                        <el-table-column type="index" align="center" label="序号"></el-table-column>
                                                        <el-table-column prop="equipmentID" label="器材编号" align="center"></el-table-column>
                                                        <el-table-column prop="equipmentName" label="名称" align="center"></el-table-column>
                                                        <el-table-column prop="equipmentCanApp" label="剩余数量" align="center"></el-table-column>
                                                        <el-table-column prop="description" label="器材描述" align="center"></el-table-column>
                                                        <el-table-column  prop="rentalQuantity"  label="租用数量"  align="center">
                                                            <template scope="scope">
                                                                <el-input-number v-model="scope.row.rentalQuantity" controls-position="right" :min="1"
                                                                                 @change="inputChange(value,scope.row)"    size="mini"></el-input-number>
                                                            </template>
                                                        </el-table-column>

                                                        <el-table-column label="操作" align="center">
                                                            <template slot-scope="scope">
                                                                <el-button :type="scope.row.isApp?'danger':'primary'"  size="mini"
                                                                           @click="closeEquipment(scope.row)">{{ scope.row.isApp?'退选':'选择'}}</el-button>
                                                            </template>
                                                        </el-table-column>
                                                    </el-table>
                                                </el-form>
                                            </el-tab-pane>


                                            <el-tab-pane label="器材预约信息" name="second" >
                                                <el-form label-position="right" label-width="1000px">
                                                    <el-table size="small" current-row-key="placeNo" :data="equipmentApp" empty-text='暂无数据，稍后重试'
                                                              :key="cerTinFoKey" stripe highlight-current-row>
                                                        <el-table-column type="index" align="center" label="序号"></el-table-column>
                                                        <el-table-column prop="equipmentID" label="器材编号" align="center"></el-table-column>
                                                        <el-table-column prop="equipmentName" label="名称" align="center"></el-table-column>
                                                        <el-table-column prop="equipmentCanApp" label="剩余数量" align="center"></el-table-column>
                                                        <el-table-column prop="description" label="器材描述" align="center"></el-table-column>
                                                        <el-table-column label="租用数量" prop="rentalQuantity" align="center">
                                                        </el-table-column>
                                                        <el-table-column label="操作" align="center">
                                                            <template slot-scope="scope">
                                                                <el-button :type="scope.row.isApp?'danger':'primary'"  size="mini"
                                                                           @click="closeEquipment(scope.row)">{{ scope.row.isApp?'退选':'选择'}}</el-button>
                                                            </template>
                                                        </el-table-column>
                                                    </el-table>
                                                </el-form>
                                            </el-tab-pane>

                                        </el-tabs>
                                    </template>
                                    <div slot="footer" class="dialog-footer">
                                        <el-button type="primary" @click="cancel()">取消</el-button>
                                        <el-button @click="printEquipment()">确定</el-button>

                                    </div>
                                </el-dialog>
                            </div>
                        </div>
                    </div>

                </el-dialog>
            </div>

            <!-- 编辑赛事标签弹层 -->
            <div class="add-form" style="width: 1000px">
                <el-dialog title="编辑赛事" :visible.sync="dialogFormVisible4EditChangeGame" width="90%">
                    <div class="app-container" >
                        <div class="box">
                            <el-tabs v-model="activeName" type="card">
                                <el-form label-position="right" label-width="140px">
                                    <el-row>

                                        <el-col :span="6">
                                            <el-form-item label="比赛号">
                                                <el-input v-model="formData.competitionNo" :disabled="true"/>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="6">
                                            <el-form-item label="赛事裁判">
                                                <el-input v-model="formData.refereeName"/>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="8">
                                            <el-form-item label="赛事时间">
                                                <el-date-picker
                                                        v-model="formData.contestTime"
                                                        type="datetimerange"
                                                        range-separator="至"
                                                        start-placeholder="开始日期"
                                                        end-placeholder="结束日期"
                                                        :default-time="['00:00:00', '23:59:59']"
                                                        format="yyyy-MM-dd HH:mm:ss"
                                                >
                                                </el-date-picker>

                                            </el-form-item>
                                        </el-col>

                                    </el-row>
                                    <el-row>
                                        <el-col :span="9">
                                            <el-form-item label="赛事场地">
                                                <el-input v-model="formData.contestFild" ></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="2">
                                            <el-button type="primary" class="butT" @click="findSite()">选择</el-button>
                                        </el-col>
                                        <el-col :span="9">
                                            <el-form-item label="使用器材">
                                                <el-input v-model="formData.useEquipment"/>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="2">
                                            <el-button type="primary" class="butT" @click="findEquipment()">选择</el-button>
                                        </el-col>

                                    </el-row>
                                    <el-row>
                                        <el-col :span="6">
                                            <el-form-item label="赛事名称">
                                                <el-input v-model="formData.contestName"/>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="8">

                                            <el-form-item label="比赛队伍1">
                                                <el-select v-model="formData.matchTeamOne" placeholder="选择比赛队伍">
                                                    <el-option v-for="plate in plates" :value="plate.teamName" :key="plate.plateId"
                                                               :label="plate.teamName"></el-option>
                                                </el-select>
                                                <%-- <el-input v-model="formData.matchTeamOne" type="matchTeam"></el-input>--%>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="8">

                                            <el-form-item label="比赛队伍2">
                                                <el-select v-model="formData.matchTeamTwo" placeholder="选择比赛队伍">
                                                    <el-option v-for="plate in plates" :value="plate.teamName" :key="plate.plateId"
                                                               :label="plate.teamName"></el-option>
                                                </el-select>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="22">
                                            <el-form-item label="备注">
                                                <el-input v-model="formData.remark" type="roleId"></el-input>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                </el-form>


                            </el-tabs>
                            <div class="filter-container">
                                <el-button @click="dialogFormVisible4EditChangeGame = false">取消</el-button>
                                <el-button type="primary" class="butT" @click="handleChangeGame()">修改比赛</el-button>
                            </div>

                            <!-- 场地选择 -->
                            <div class="add-form" style="width: 800px">
                                <el-dialog title="场地选择" :visible.sync="dialogFormVisible4EditCloseSite"  append-to-body>
                                    <template>
                                        <el-tabs v-model="activeName" type="card">
                                            <el-tab-pane label="基本信息" name="first">
                                                <el-form label-position="right" label-width="100px">
                                                    <div class="filter-container" >
                                                        <el-input placeholder="场地号/场地名" v-model="site.queryString" style="width: 200px;"
                                                                  class="filter-item" @keyup.enter.native="handleFilter"></el-input>
                                                        <el-input v-model="site.orderData"
                                                                  type="date"
                                                                  style="width: 200px;"
                                                                  class="filter-item"
                                                                  placeholder="选择日期"
                                                                  format="yyyy 年 MM 月 dd 日"
                                                                  :picker-options="expireTimeOPtion">
                                                        </el-input>
                                                        <el-select placeholder="请选择" v-model="site.orderTimeSub"  style="width: 200px;" class="filter-item">
                                                            <el-option v-for="item in kindList" :key="item.id" :value="item.name"></el-option>
                                                        </el-select>
                                                        <el-button @click="findSite()" class="dalfBut">查询</el-button>

                                                    </div>
                                                    <el-table size="small" current-row-key="placeNo" :data="dataListSiteMess" empty-text='暂无数据，稍后重试' stripe highlight-current-row>
                                                        <el-table-column type="index" align="center" label="序号"></el-table-column>
                                                        <el-table-column prop="placeNo" label="场地号" align="center"></el-table-column>
                                                        <el-table-column prop="placeName" label="场地名" align="center"></el-table-column>
                                                        <el-table-column prop="orderData" label="租用日期" align="center"></el-table-column>
                                                        <el-table-column prop="orderTimeSub" label="时间段" align="center"></el-table-column>
                                                        <el-table-column  prop="rentalQuantity" label="操作" align="center">
                                                            <template slot-scope="scope">
                                                                <el-button type="primary" size="mini" @click="handleChoseSite(scope.row)">选择</el-button>
                                                            </template>
                                                        </el-table-column>
                                                    </el-table>
                                                    <div class="pagination-container">
                                                        <el-pagination
                                                                class="pagiantion"
                                                                :current-page="site.pageNow"
                                                                :page-size="site.pageSize"
                                                                layout="total, prev, pager, next, jumper"
                                                                :total="site.total">
                                                        </el-pagination>
                                                    </div>
                                                </el-form>
                                            </el-tab-pane>

                                        </el-tabs>
                                    </template>
                                    <div slot="footer" class="dialog-footer">
                                        <el-button type="primary" @click="cancel()">取消</el-button>
                                        <el-button @click="dialogFormVisible4EditCloseSite = false">确定</el-button>
                                    </div>
                                </el-dialog>
                            </div>

                            <!-- 器材选择 -->
                            <div class="add-form" style="width: 1000px">
                                <el-dialog title="器材选择" :visible.sync="dialogFormVisible4EditCloseEquipment" width="80%" append-to-body>
                                    <template>
                                        <el-tabs v-model="activeName" type="card" >
                                            <el-tab-pane label="基本信息" name="first" >
                                                <el-form label-position="right" label-width="1000px">
                                                    <div class="filter-container" >
                                                        <el-input placeholder="器材号/器材名" v-model="pagination.queryString" style="width: 200px;"
                                                                  class="filter-item" @keyup.enter.native="handleFilter"></el-input>
                                                        <el-input v-model="pagination.rentData"
                                                                  type="date"
                                                                  style="width: 200px;"
                                                                  class="filter-item"
                                                                  placeholder="选择日期"
                                                                  format="yyyy 年 MM 月 dd 日"
                                                                  :picker-options="expireTimeOPtion">
                                                        </el-input>
                                                        <el-select placeholder="请选择" v-model="pagination.rentTimeSub"  style="width: 200px;" class="filter-item">
                                                            <el-option v-for="item in kindList" :key="item.id" :value="item.name"></el-option>
                                                        </el-select>
                                                        <el-button @click="findEquipment()" class="dalfBut">查询</el-button>

                                                    </div>
                                                    <el-table size="small" current-row-key="placeNo" :data="equipment" :key="cerTinFoKey" empty-text='暂无数据，稍后重试'
                                                              stripe highlight-current-row>
                                                        <el-table-column type="index" align="center" label="序号"></el-table-column>
                                                        <el-table-column prop="equipmentID" label="器材编号" align="center"></el-table-column>
                                                        <el-table-column prop="equipmentName" label="名称" align="center"></el-table-column>
                                                        <el-table-column prop="equipmentCanApp" label="剩余数量" align="center"></el-table-column>
                                                        <el-table-column prop="description" label="器材描述" align="center"></el-table-column>
                                                        <el-table-column  prop="rentalQuantity"  label="租用数量"  align="center">
                                                            <template scope="scope">
                                                                <el-input-number v-model="scope.row.rentalQuantity" controls-position="right" :min="1"
                                                                                 @change="inputChange(value,scope.row)"    size="mini"></el-input-number>
                                                            </template>
                                                        </el-table-column>

                                                        <el-table-column label="操作" align="center">
                                                            <template slot-scope="scope">
                                                                <el-button :type="scope.row.isApp?'danger':'primary'"  size="mini"
                                                                           @click="closeEquipment(scope.row)">{{ scope.row.isApp?'退选':'选择'}}</el-button>
                                                            </template>
                                                        </el-table-column>
                                                    </el-table>
                                                </el-form>
                                            </el-tab-pane>


                                            <el-tab-pane label="器材预约信息" name="second" >
                                                <el-form label-position="right" label-width="1000px">
                                                    <el-table size="small" current-row-key="placeNo" :data="equipmentApp" empty-text='暂无数据，稍后重试'
                                                              :key="cerTinFoKey" stripe highlight-current-row>
                                                        <el-table-column type="index" align="center" label="序号"></el-table-column>
                                                        <el-table-column prop="equipmentID" label="器材编号" align="center"></el-table-column>
                                                        <el-table-column prop="equipmentName" label="名称" align="center"></el-table-column>
                                                        <el-table-column prop="equipmentCanApp" label="剩余数量" align="center"></el-table-column>
                                                        <el-table-column prop="description" label="器材描述" align="center"></el-table-column>
                                                        <el-table-column label="租用数量" prop="rentalQuantity" align="center">
                                                        </el-table-column>
                                                        <el-table-column label="操作" align="center">
                                                            <template slot-scope="scope">
                                                                <el-button :type="scope.row.isApp?'danger':'primary'"  size="mini"
                                                                           @click="closeEquipment(scope.row)">{{ scope.row.isApp?'退选':'选择'}}</el-button>
                                                            </template>
                                                        </el-table-column>
                                                    </el-table>
                                                </el-form>
                                            </el-tab-pane>

                                        </el-tabs>
                                    </template>
                                    <div slot="footer" class="dialog-footer">
                                        <el-button type="primary" @click="cancel()">取消</el-button>
                                        <el-button @click="printEquipment()">确定</el-button>

                                    </div>
                                </el-dialog>
                            </div>
                        </div>
                    </div>

                </el-dialog>
            </div>
        </div>
    </div>
</div>
</body>

<script>
    // 设置默认选中时间当天0:00:00~23:59：59
    const startDate = new Date()
    const endDate = new Date()
    startDate.setHours(0)
    startDate.setMinutes(0)
    startDate.setSeconds(0)
    endDate.setHours(23)
    endDate.setMinutes(59)
    endDate.setSeconds(59)
    var vue = new Vue({
        el: '#app',
        data:{
            plates: [],
            form: {
                title: '',
                plate: '',
                content: ''
            },

            activeName:'first',//添加/编辑窗口Tab标签名称
            pagination: {//分页相关属性
                pageNow: 1,
                pageSize:10,
                total:100,
                queryString:null,
                contesState:"审核通过",
            },
            paginationGame: {//分页相关属性
                pageNow: 1,
                pageSize:10,
                total:100,
                queryString:null,
                rentTimeSub:"08点-11点",
                rentData:new Date().getFullYear()+"-"+(new Date().getMonth()+1)+"-"+new Date().getDate(),
            },
            site: {//分页相关属性
                pageNow: 1,
                pageSize:10,
                total:100,
                queryString:null,
                orderTimeSub:"08点-11点",
                orderData:new Date().getFullYear()+"-"+(new Date().getMonth()+1)+"-"+new Date().getDate(),
            },
            equipment: {//分页相关属性
                pageNow: 1,
                pageSize:10,
                total:100,
                queryString:null,
                rentTimeSub:"08点-11点",
                rentalQuantity:0,
                rentData:new Date().getFullYear()+"-"+(new Date().getMonth()+1)+"-"+new Date().getDate(),
            },
            equipmentApp: {//分页相关属性
                equipmentID:"",
                equipmentName:"",
                equipmentCanApp:"",
                rentalQuantity:"",
                pageNow: 1,
                pageSize:10,
                total:100,
                queryString:null,
                rentTimeSub:"08点-11点",
                rentData:new Date().getFullYear()+"-"+(new Date().getMonth()+1)+"-"+new Date().getDate(),
            },
            dataList: [],//列表数据
            dataListGame: [],//列表数据
            dataListSiteMess: [],//列表数据
            formData: {},//表单数据
            tableData:[],//新增和编辑表单中对应的检查项列表数据
            checkitemIds:[],//新增和编辑表单中检查项对应的复选框，基于双向绑定可以进行回显和数据提交
            dialogFormVisible: false,//控制添加窗口显示/隐藏
            dialogFormVisible4Edit:false,//控制编辑窗口显示/隐藏
            dialogFormVisible4EditAddGame:false,//控制编辑窗口显示/隐藏
            dialogFormVisible4EditCloseSite:false,//控制编辑窗口显示/隐藏
            dialogFormVisible4EditCloseEquipment:false,//控制编辑窗口显示/隐藏
            dialogFormVisible4EditChangeGame:false,//控制编辑窗口显示/隐藏
            expireTimeOPtion: {
                disabledDate(time) {
                    return time.getTime() < Date.now();  //如果没有后面的-8.64e7就是不可以选择今天的
                }
            },
            siteData:{},//场地数据
            equipmentData:{},//器材数据
            dialogFormVisible4EditEquipment:false,//控制编辑窗口显示/隐藏
            serachForm:[startDate.valueOf(), endDate.valueOf()],
            kindList:[{name:"08点-10点",id:"1"},{name:"10点-12点",id:2},{name:"13点-15点",id:3}
                ,{name:"15点-17点",id:4},{name:"17点-19点",id:5},{name:"19点-21点",id:6}],
            cerTinFoKey:false,
            // 获取row的key值
            getRowKeys(row) {

                return row.competitionNo;
            },
            // 要展开的行，数值的元素是row的key值
            expands: [],
        },
        created() {
            this.findPage();
        },



        methods: {
            getUserPermissions() {
                return axios.post("<%=request.getContextPath()%>/equipmentRent/add.do",this.equipmentData)
                    .then((response)=> {
                        if(response.data.success){
                            //新增成功，弹出成功提示
                        }else{
                            //新增失败，弹出错误提示
                            this.$message.error(response.data.data);
                            return;
                        }
                    })
            },

            //编辑赛事
            handleChangeGame() {
                this.$confirm('修改赛事，请核对信息, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    axios.post("<%=request.getContextPath()%>/game/change.do",this.formData)
                        .then((response)=> {
                            if(response.data.success){
                                this.dialogFormVisible4EditChangeGame = false;
                                //修改成功，弹出成功提示
                                this.$message({
                                    message: response.data.data,
                                    type: 'success',
                                })

                            }else{
                                //新增失败，弹出错误提示
                                this.$message.error(response.data.data);
                            }
                        })
                }).catch(() => {
                    // 点击取消进行的操作
                })

            },
            //添加
            async handleAdd () {
                //发送ajax请求将模型数据提交到后台处理
                if(this.formData["contestTime"] !== null){
                    this.formData["contestStartTime"]  = this.formData["contestTime"][0].getFullYear() + '-' + (this.formData["contestTime"][0].getMonth()+1)
                        + '-' + this.formData["contestTime"][0].getDate() + ' ' + this.formData["contestTime"][0].getHours()
                        + ':' + this.formData["contestTime"][0].getMinutes() + ':' + this.formData["contestTime"][0].getSeconds();
                    this.formData["contestEndTime"] = this.formData["contestTime"][1].getFullYear() + '-' + (this.formData["contestTime"][1].getMonth()+1)
                        + '-' + this.formData["contestTime"][1].getDate() + ' ' + this.formData["contestTime"][1].getHours()
                        + ':' + this.formData["contestTime"][1].getMinutes() + ':' + this.formData["contestTime"][1].getSeconds();
                }
                //场地申请
                axios.post("<%=request.getContextPath()%>/denueHireMessage/add.do",this.siteData)
                    .then((response)=> {
                        if(response.data.success){

                        }else{
                            //新增失败，弹出错误提示
                            this.$message.error(response.data.data);

                        }
                    })

                //器材申请
                for(var i=0;i<this.equipmentApp.length;i++){
                    //this.formData.useEquipment = JSON.parse(this.formData.useEquipment  + this.equipmentApp[i]["equipmentName"] + "," +this.equipmentApp[i]["rentalQuantity"] + ";");
                    this.equipmentData.equipmentID = this.equipmentApp[i]["equipmentID"];
                    this.equipmentData.equipmentName = this.equipmentApp[i]["equipmentName"];//器材名
                    this.equipmentData.rentTimeSub = this.pagination.rentTimeSub;
                    this.equipmentData.rentData =  this.pagination.rentData;//租用日期
                    this.equipmentData.rentalQuantity=this.equipmentApp[i]["rentalQuantity"];//租用数量
                    this.equipmentData.rentTime = new Date().getFullYear()+"-"+(new Date().getMonth()+1)+"-"+new Date().getDate();//租用日期
                    this.equipmentData.equipmentDamage = "无";
                    this.equipmentData.rent = "0";
                    this.equipmentData.equipmentUserID = sessionStorage.getItem("username");//租用用户编号
                    await this.getUserPermissions();
                }

                //赛事申请
                console.log(this.formData);
                axios.post("<%=request.getContextPath()%>/game/add.do",this.formData)
                    .then((response)=> {
                        if(response.data.success){
                            //新增成功，弹出成功提示
                            this.formData = {};
                            this.$message({
                                message: response.data.data,
                                type: 'success',
                            }).finally(()=> {
                                this.formData = {};
                            });
                        }else{
                            //新增失败，弹出错误提示
                            this.$message.error(response.data.data);
                            return;
                        }
                    })
            },

            //打印器材
            printEquipment(){
                this.formData.useEquipment = "";
                this.dialogFormVisible4EditCloseEquipment = false
                for(var i=0;i<this.equipmentApp.length;i++){
                    this.formData.useEquipment += this.equipmentApp[i]["equipmentName"] + "," +this.equipmentApp[i]["rentalQuantity"] + ";";
                }

            },

            //选择器材
            closeEquipment(row){
                if(row["rentalQuantity"] > row["equipmentCanApp"]) {
                    this.$confirm('超出器材约数量，请重新输入器材数', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(() => {

                    }).catch(() => {
                        // 点击取消进行的操作
                    })
                }else{
                    if(row["isApp"] === false){
                        for(var i=0;i<this.equipment.length;i++){
                            if(this.equipment[i]["equipmentID"] === row["equipmentID"]){
                                this.equipment[i]["isApp"] = true;
                                this.equipmentApp.push(row);
                                //this.equipmentApp[i]["isApp"] = !this.equipmentApp[i]["isApp"]
                            }
                        }
                    }else{
                        for(var j=0;j<this.equipment.length;j++){
                            if(this.equipment[j]["equipmentID"] === row["equipmentID"]){
                                this.equipment[j]["isApp"] = false;
                            }
                        }
                        for(var k=0;k<this.equipmentApp.length;k++){
                            if(this.equipmentApp[k]["equipmentID"] === row["equipmentID"]){
                                this.equipmentApp.splice(k,1);
                            }
                        }
                    }
                    this.cerTinFoKey = !this.cerTinFoKey;
                }
            },

            //选择场地，信息保存
            handleChoseSite(row){
                this.formData.contestFild = row["placeName"];
                this.siteData.placeNo = row["placeNo"];
                this.siteData.placeName = row["placeName"];
                this.siteData.orderCost = 0;
                this.siteData.orderTimeSub = row["orderTimeSub"];
                this.siteData.orderData =  row["orderData"];
            },
            //取消
            cancel(){
                this.formData.contestFild = null;
                this.dialogFormVisible4 = false;
                this.dialogFormVisible4EditCloseSite = false;
                this.dialogFormVisible4EditCloseEquipment = false;
                this.formData.useEquipment = null;
            },
            clickRowHandle(row) {
                if (this.expands.includes(row.competitionNo)) {
                    this.expands = this.expands.filter(val => val !== row.competitionNo);
                } else {
                    //判断是否已经存在展开的行
                    if (this.expands.length !== 0) {
                        //如果存在展开行,清空expands数组,使它关闭
                        this.expands.splice(0, this.expands.length);
                        //打开点击的行
                        this.expands.push(row.competitionNo);
                    } else {
                        //如果不存在展开行,直接push打开点击的行
                        this.expands.push(row.competitionNo);
                    }
                }
                //分页参数
                var param = {
                    pageNow:this.pagination.pageNow,//页码
                    pageSize:this.pagination.pageSize,//每页显示的记录数
                    competitionNo:row["competitionNo"],//查询条件
                };
                //请求后台
                axios.post("<%=request.getContextPath()%>/game/find.do",param).then((response)=> {
                    //为模型数据赋值，基于VUE的双向绑定展示到页面
                    console.log(response.data.data.rows);
                    this.dataListGame = response.data.data.rows;
                });
            },
            //编辑
            handleChange() {
                this.$confirm('请核对信息, 是否确认修改比赛信息?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    //发送ajax请求，提交模型数据
                    axios.post("<%=request.getContextPath()%>/competition/change.do",this.formData).then((response)=> {
                        //隐藏编辑窗口
                        this.dialogFormVisible4Edit = false;
                        if(response.data.success){
                            this.$message({
                                message: response.data.data,
                                type: 'success'
                            });
                        }else{
                            this.$message.error(response.data.data);
                        }
                    }).finally(()=> {
                        this.findPage();
                    });
                }).catch(() => {
                    // 点击取消进行的操作
                })

            },
            //添加
            handleAddGame () {
                this.$confirm('请核对信息, 是否确认添加赛事?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    console.log(this.formData);
                    //发送ajax请求将模型数据提交到后台处理
                    axios.post("<%=request.getContextPath()%>/competition/add.do",this.formData)
                        .then((response)=> {
                            //关闭新增窗口
                            this.dialogFormVisible = false;
                            if(response.data.success){
                                //新增成功，弹出成功提示
                                this.$message({
                                    message: response.data.data,
                                    type: 'success'
                                });
                            }else{
                                //新增失败，弹出错误提示
                                this.$message.error(response.data.data);
                            }
                        }).finally(()=> {
                        this.findPage();
                    });
                }).catch(() => {
                    // 点击取消进行的操作
                })

            },
            //分页查询
            findPage() {
                //分页参数
                var param = {
                    pageNow:this.pagination.pageNow,//页码
                    pageSize:this.pagination.pageSize,//每页显示的记录数
                    competitionNo:this.pagination.queryString,//查询条件
                    competitionName:this.pagination.queryString,//查询条件
                    contestStartTime:this.pagination.contestStartTime,
                    //queryString:this.pagination.queryString//查询条件
                };
                console.log(param);
                //请求后台
                axios.post("<%=request.getContextPath()%>/competition/find.do",param).then((response)=> {
                    //为模型数据赋值，基于VUE的双向绑定展示到页面
                    console.log(response.data.data.rows);
                    this.dataList = response.data.data.rows;
                    this.pagination.total =  response.data.data["totalCount"];
                });
            },
            // 重置表单
            resetForm() {
                this.formData = {};
            },
            // 弹出添加窗口
            handleCreate() {
                this.resetForm();
                this.formData = {};
                this.dialogFormVisible = true;
                //默认切换到第一个标签页（基本信息）
                this.activeName='first';
                //重置
                this.checkitemIds = [];
            },
            // 弹出编辑窗口
            handleUpdate(row) {
                console.log("Game编辑");
                console.log(row["competitionNo"]);
                var param = {
                    competitionNo:row["competitionNo"]//查询条件
                };
                axios.post("<%=request.getContextPath()%>/competition/find.do",param).then((res)=>{
                    if(res.data.data.rows.length === 1){
                        //弹出编辑窗口
                        this.dialogFormVisible4Edit = true;
                        //为模型数据赋值，通过VUE数据双向绑定进行信息的回显
                        this.formData={};
                        console.log(res.data.data.rows[0]);
                        this.formData = res.data.data.rows[0];
                    }else{
                        this.$message.error("获取数据失败，请刷新当前页面");
                    }
                });
            },

            // 弹出编辑窗口
            handleUpdateGame(row) {
                var param = {
                    contesNo:row["contesNo"],
                };
                axios.post("<%=request.getContextPath()%>/game/find.do",param).then((res)=>{
                    console.log(res.data.data);
                    if(res.data.data.rows.length === 1){
                        //弹出编辑窗口
                        this.dialogFormVisible4EditChangeGame = true;
                        var param2 = {
                            competitionNo:row["competitionNo"]//查询条件
                        };
                        axios.post("<%=request.getContextPath()%>/competitionTeam/find.do",param2).then((res2)=>{
                            console.log(res2.data.data.rows);
                            this.plates = res2.data.data.rows;
                        });
                        //为模型数据赋值，通过VUE数据双向绑定进行信息的回显
                        this.formData={};
                        this.formData = res.data.data.rows[0];
                    }else{
                        this.$message.error("获取数据失败，请刷新当前页面");
                    }
                });
            },


            // 弹出添加比赛窗口
            handleAddMess(row) {
                var param = {
                    competitionNo:row["competitionNo"]//查询条件
                };
                axios.post("<%=request.getContextPath()%>/competition/find.do",param).then((res)=>{
                    if(res.data.data.rows.length === 1){
                        //弹出编辑窗口
                        this.dialogFormVisible4EditAddGame = true;
                        axios.post("<%=request.getContextPath()%>/competitionTeam/find.do",param).then((res2)=>{
                            this.plates = res2.data.data.rows;


                        });
                        //为模型数据赋值，通过VUE数据双向绑定进行信息的回显
                        this.formData={};

                        console.log(res.data.data.rows[0]);
                        this.formData = res.data.data.rows[0];
                        this.formData.competitionNo = row["competitionNo"];
                    }else{
                        this.$message.error("获取数据失败，请刷新当前页面");
                    }
                });
            },
            //切换页码
            handleCurrentChange(pageNow) {
                //pageNow为切换后的页码
                this.pagination.pageNow = pageNow;
                this.findPage();
            },
            // 删除
            handleDelete(row) {
                this.$confirm('删除比赛?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    var param = {
                        competitionNo:row["competitionNo"]
                    };
                    axios.post("<%=request.getContextPath()%>/game/delete.do",param).then((res)=>{
                        if(res.data.success){
                            axios.post("<%=request.getContextPath()%>/competition/delete.do",param).then((res2)=>{
                                if(res2.data.success){
                                    this.findPage();
                                    this.$message({
                                        message: res2.data.data,
                                        type: 'success'
                                    });
                                }else{
                                    this.$message.error("删除比赛失败");
                                }
                            })
                        }else{
                            this.$message.error("删除赛事失败");
                        }
                    })
                }).catch(() => {
                    // 点击取消进行的操作
                })

            },
            // 删除
            handleDeleteGame(row) {
                this.$confirm('删除比赛, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    var param = {
                        contesNo:row["contesNo"]
                    };
                    axios.post("<%=request.getContextPath()%>/game/delete.do",param).then((res)=>{
                        if(res.data.success){
                            this.$message({
                                message: res.data.data,
                                type: 'success'
                            });
                        }else{
                            this.$message.error("删除失败");
                        }
                    }).finally(()=> {
                        //请求后台
                        var param = {
                            pageNow:this.pagination.pageNow,//页码
                            pageSize:this.pagination.pageSize,//每页显示的记录数
                            competitionNo:row["competitionNo"],//查询条件
                        };
                        axios.post("<%=request.getContextPath()%>/game/find.do",param).then((response)=> {
                            //为模型数据赋值，基于VUE的双向绑定展示到页面
                            console.log(response.data.data.rows);
                            this.dataListGame = response.data.data.rows;
                        });
                    });
                }).catch(() => {
                    // 点击取消进行的操作
                })

            },
            //场地预约信息
            findSite() {
                //分页参数
                var param = {
                    pageNow:this.site.pageNow,//页码
                    pageSize:this.site.pageSize,//每页显示的记录数
                    placeNo:this.site.queryString,//场地号
                    placeName:this.site.queryString,//场地号
                    orderData:this.site.orderData,//租用日期
                    orderTimeSub:this.site.orderTimeSub,//租用时间段

                    //queryString:this.pagination.queryString//查询条件
                };
                //请求后台
                axios.post("<%=request.getContextPath()%>/denueHireMessage/findCanApp.do",param).then((response)=> {
                    //为模型数据赋值，基于VUE的双向绑定展示到页面
                    this.dialogFormVisible4EditCloseSite = true;

                    this.dataListSiteMess = response.data.data.rows;
                    console.log(this.dataListSiteMess);
                    this.site.total =  response.data.data["totalCount"];
                });
            },


            findEquipment() {
                //分页参数
                var paramEquipment = {
                    pageNow:this.equipment.pageNow,//页码
                    pageSize:1000,//每页显示的记录数
                    equipmentID:this.pagination.queryString,//场地号
                    equipmentName:this.pagination.queryString,//场地名
                    rentData:this.pagination.rentData,//租用日期
                    rentTimeSub:this.pagination.rentTimeSub//租用时间
                };
                //请求后台
                axios.post("<%=request.getContextPath()%>/equipmentRent/findCanRent.do",paramEquipment).then((response)=> {
                    //为模型数据赋值，基于VUE的双向绑定展示到页面
                    this.dialogFormVisible4EditCloseEquipment = true;
                    localStorage.setItem('equipment', JSON.stringify( response.data.data.rows));
                    localStorage.setItem('equipmentApp', JSON.stringify( response.data.data.rows));
                    this.equipment = JSON.parse(localStorage.getItem('equipment'));
                    //this.equipmentApp = JSON.parse(localStorage.getItem('equipmentApp'));
                    this.equipment.total =  response.data.data["totalCount"];
                    for(var i=0;i<this.equipment.length;i++){
                        this.equipment[i]["isApp"] = false;
                        this.equipment[i]["rentalQuantity"] = 1;
                        //this.equipmentApp[i]["isApp"] =  true;
                        //this.equipmentApp[i]["rentalQuantity"] =  1;

                    }
                    console.log(this.equipment);
                    this.equipmentApp =[];
                    this.equipmentApp.total =  response.data.data["totalCount"];

                });
            },
        }
    })
</script>
</html>
